home *** CD-ROM | disk | FTP | other *** search
MacBinary | 1990-03-21 | 6.8 KB | [TEXT/MPS ] |
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: MacBinary
(archive/macBinary).
Confidence | Program | Detection | Match Type | Support
|
---|
66%
| dexvert
| Compact Compressed (Unix) (archive/compact)
| ext
| Supported |
10%
| dexvert
| MacBinary (archive/macBinary)
| fallback
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| MacBinary II, Wed Mar 21 14:10:18 1990, modified Wed Mar 21 14:10:18 1990, creator 'MPS ', type ASCII, 6164 bytes "alloca.c" , at 0x1894 428 bytes resource
| default (weak)
| |
99%
| file
| data
| default
| |
74%
| TrID
| Macintosh plain text (MacBinary)
| default
| |
25%
| TrID
| MacBinary 2
| default (weak)
| |
100%
| siegfried
| fmt/1762 MacBinary (II)
| default
| |
100%
| lsar
| MacBinary
| default
|
|
id metadata |
---|
key | value |
---|
macFileType | [TEXT] |
macFileCreator | [MPS ] |
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 08 61 6c 6c 6f 63 61 | 2e 63 00 00 00 00 00 00 |..alloca|.c......|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 50 53 | 20 00 00 00 00 00 00 00 |.TEXTMPS| .......|
|00000050| 00 00 00 00 00 18 14 00 | 00 01 ac a2 2d 82 1a a2 |........|....-...|
|00000060| 2d 82 1a 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |-.......|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 39 2f 00 00 |........|....9/..|
|00000080| 2f 2a 0d 09 61 6c 6c 6f | 63 61 20 2d 2d 20 28 6d |/*..allo|ca -- (m|
|00000090| 6f 73 74 6c 79 29 20 70 | 6f 72 74 61 62 6c 65 20 |ostly) p|ortable |
|000000a0| 70 75 62 6c 69 63 2d 64 | 6f 6d 61 69 6e 20 69 6d |public-d|omain im|
|000000b0| 70 6c 65 6d 65 6e 74 61 | 74 69 6f 6e 20 2d 2d 20 |plementa|tion -- |
|000000c0| 44 20 41 20 47 77 79 6e | 0d 0d 09 6c 61 73 74 20 |D A Gwyn|...last |
|000000d0| 65 64 69 74 3a 09 38 36 | 2f 30 35 2f 33 30 09 72 |edit:.86|/05/30.r|
|000000e0| 6d 73 0d 09 20 20 20 69 | 6e 63 6c 75 64 65 20 63 |ms.. i|nclude c|
|000000f0| 6f 6e 66 69 67 2e 68 2c | 20 73 69 6e 63 65 20 6f |onfig.h,| since o|
|00000100| 6e 20 56 4d 53 20 69 74 | 20 72 65 6e 61 6d 65 73 |n VMS it| renames|
|00000110| 20 73 6f 6d 65 20 73 79 | 6d 62 6f 6c 73 2e 0d 09 | some sy|mbols...|
|00000120| 20 20 20 55 73 65 20 78 | 6d 61 6c 6c 6f 63 20 69 | Use x|malloc i|
|00000130| 6e 73 74 65 61 64 20 6f | 66 20 6d 61 6c 6c 6f 63 |nstead o|f malloc|
|00000140| 2e 0d 20 20 20 4d 50 57 | 20 63 68 61 6e 67 65 73 |.. MPW| changes|
|00000150| 0d 20 20 20 20 20 43 6f | 70 79 72 69 67 68 74 20 |. Co|pyright |
|00000160| 28 43 29 20 31 39 38 39 | 2c 20 31 39 39 30 20 41 |(C) 1989|, 1990 A|
|00000170| 70 70 6c 65 20 43 6f 6d | 70 75 74 65 72 2c 20 49 |pple Com|puter, I|
|00000180| 6e 63 2e 0d 09 54 68 69 | 73 20 69 6d 70 6c 65 6d |nc...Thi|s implem|
|00000190| 65 6e 74 61 74 69 6f 6e | 20 6f 66 20 74 68 65 20 |entation| of the |
|000001a0| 50 57 42 20 6c 69 62 72 | 61 72 79 20 61 6c 6c 6f |PWB libr|ary allo|
|000001b0| 63 61 28 29 20 66 75 6e | 63 74 69 6f 6e 2c 0d 09 |ca() fun|ction,..|
|000001c0| 77 68 69 63 68 20 69 73 | 20 75 73 65 64 20 74 6f |which is| used to|
|000001d0| 20 61 6c 6c 6f 63 61 74 | 65 20 73 70 61 63 65 20 | allocat|e space |
|000001e0| 6f 66 66 20 74 68 65 20 | 72 75 6e 2d 74 69 6d 65 |off the |run-time|
|000001f0| 20 73 74 61 63 6b 20 73 | 6f 0d 09 74 68 61 74 20 | stack s|o..that |
|00000200| 69 74 20 69 73 20 61 75 | 74 6f 6d 61 74 69 63 61 |it is au|tomatica|
|00000210| 6c 6c 79 20 72 65 63 6c | 61 69 6d 65 64 20 75 70 |lly recl|aimed up|
|00000220| 6f 6e 20 70 72 6f 63 65 | 64 75 72 65 20 65 78 69 |on proce|dure exi|
|00000230| 74 2c 20 0d 09 77 61 73 | 20 69 6e 73 70 69 72 65 |t, ..was| inspire|
|00000240| 64 20 62 79 20 64 69 73 | 63 75 73 73 69 6f 6e 73 |d by dis|cussions|
|00000250| 20 77 69 74 68 20 4a 2e | 20 51 2e 20 4a 6f 68 6e | with J.| Q. John|
|00000260| 73 6f 6e 20 6f 66 20 43 | 6f 72 6e 65 6c 6c 2e 0d |son of C|ornell..|
|00000270| 0d 09 49 74 20 73 68 6f | 75 6c 64 20 77 6f 72 6b |..It sho|uld work|
|00000280| 20 75 6e 64 65 72 20 61 | 6e 79 20 43 20 69 6d 70 | under a|ny C imp|
|00000290| 6c 65 6d 65 6e 74 61 74 | 69 6f 6e 20 74 68 61 74 |lementat|ion that|
|000002a0| 20 75 73 65 73 20 61 6e | 0d 09 61 63 74 75 61 6c | uses an|..actual|
|000002b0| 20 70 72 6f 63 65 64 75 | 72 65 20 73 74 61 63 6b | procedu|re stack|
|000002c0| 20 28 61 73 20 6f 70 70 | 6f 73 65 64 20 74 6f 20 | (as opp|osed to |
|000002d0| 61 20 6c 69 6e 6b 65 64 | 20 6c 69 73 74 20 6f 66 |a linked| list of|
|000002e0| 0d 09 66 72 61 6d 65 73 | 29 2e 20 20 54 68 65 72 |..frames|). Ther|
|000002f0| 65 20 61 72 65 20 73 6f | 6d 65 20 70 72 65 70 72 |e are so|me prepr|
|00000300| 6f 63 65 73 73 6f 72 20 | 63 6f 6e 73 74 61 6e 74 |ocessor |constant|
|00000310| 73 20 74 68 61 74 20 63 | 61 6e 0d 09 62 65 20 64 |s that c|an..be d|
|00000320| 65 66 69 6e 65 64 20 77 | 68 65 6e 20 63 6f 6d 70 |efined w|hen comp|
|00000330| 69 6c 69 6e 67 20 66 6f | 72 20 79 6f 75 72 20 73 |iling fo|r your s|
|00000340| 70 65 63 69 66 69 63 20 | 73 79 73 74 65 6d 2c 20 |pecific |system, |
|00000350| 66 6f 72 0d 09 69 6d 70 | 72 6f 76 65 64 20 65 66 |for..imp|roved ef|
|00000360| 66 69 63 69 65 6e 63 79 | 3b 20 68 6f 77 65 76 65 |ficiency|; howeve|
|00000370| 72 2c 20 74 68 65 20 64 | 65 66 61 75 6c 74 73 20 |r, the d|efaults |
|00000380| 73 68 6f 75 6c 64 20 62 | 65 20 6f 6b 61 79 2e 0d |should b|e okay..|
|00000390| 0d 09 54 68 65 20 67 65 | 6e 65 72 61 6c 20 63 6f |..The ge|neral co|
|000003a0| 6e 63 65 70 74 20 6f 66 | 20 74 68 69 73 20 69 6d |ncept of| this im|
|000003b0| 70 6c 65 6d 65 6e 74 61 | 74 69 6f 6e 20 69 73 20 |plementa|tion is |
|000003c0| 74 6f 20 6b 65 65 70 0d | 09 74 72 61 63 6b 20 6f |to keep.|.track o|
|000003d0| 66 20 61 6c 6c 20 61 6c | 6c 6f 63 61 28 29 2d 61 |f all al|loca()-a|
|000003e0| 6c 6c 6f 63 61 74 65 64 | 20 62 6c 6f 63 6b 73 2c |llocated| blocks,|
|000003f0| 20 61 6e 64 20 72 65 63 | 6c 61 69 6d 20 61 6e 79 | and rec|laim any|
|00000400| 0d 09 74 68 61 74 20 61 | 72 65 20 66 6f 75 6e 64 |..that a|re found|
|00000410| 20 74 6f 20 62 65 20 64 | 65 65 70 65 72 20 69 6e | to be d|eeper in|
|00000420| 20 74 68 65 20 73 74 61 | 63 6b 20 74 68 61 6e 20 | the sta|ck than |
|00000430| 74 68 65 20 63 75 72 72 | 65 6e 74 0d 09 69 6e 76 |the curr|ent..inv|
|00000440| 6f 63 61 74 69 6f 6e 2e | 20 20 54 68 69 73 20 68 |ocation.| This h|
|00000450| 65 75 72 69 73 74 69 63 | 20 64 6f 65 73 20 6e 6f |euristic| does no|
|00000460| 74 20 72 65 63 6c 61 69 | 6d 20 73 74 6f 72 61 67 |t reclai|m storag|
|00000470| 65 20 61 73 0d 09 73 6f | 6f 6e 20 61 73 20 69 74 |e as..so|on as it|
|00000480| 20 62 65 63 6f 6d 65 73 | 20 69 6e 76 61 6c 69 64 | becomes| invalid|
|00000490| 2c 20 62 75 74 20 69 74 | 20 77 69 6c 6c 20 64 6f |, but it| will do|
|000004a0| 20 73 6f 20 65 76 65 6e | 74 75 61 6c 6c 79 2e 0d | so even|tually..|
|000004b0| 0d 09 41 73 20 61 20 73 | 70 65 63 69 61 6c 20 63 |..As a s|pecial c|
|000004c0| 61 73 65 2c 20 61 6c 6c | 6f 63 61 28 30 29 20 72 |ase, all|oca(0) r|
|000004d0| 65 63 6c 61 69 6d 73 20 | 73 74 6f 72 61 67 65 20 |eclaims |storage |
|000004e0| 77 69 74 68 6f 75 74 0d | 09 61 6c 6c 6f 63 61 74 |without.|.allocat|
|000004f0| 69 6e 67 20 61 6e 79 2e | 20 20 49 74 20 69 73 20 |ing any.| It is |
|00000500| 61 20 67 6f 6f 64 20 69 | 64 65 61 20 74 6f 20 75 |a good i|dea to u|
|00000510| 73 65 20 61 6c 6c 6f 63 | 61 28 30 29 20 69 6e 0d |se alloc|a(0) in.|
|00000520| 09 79 6f 75 72 20 6d 61 | 69 6e 20 63 6f 6e 74 72 |.your ma|in contr|
|00000530| 6f 6c 20 6c 6f 6f 70 2c | 20 65 74 63 2e 20 74 6f |ol loop,| etc. to|
|00000540| 20 66 6f 72 63 65 20 67 | 61 72 62 61 67 65 20 63 | force g|arbage c|
|00000550| 6f 6c 6c 65 63 74 69 6f | 6e 2e 0d 2a 2f 0d 23 69 |ollectio|n..*/.#i|
|00000560| 66 6e 64 65 66 20 6c 69 | 6e 74 0d 73 74 61 74 69 |fndef li|nt.stati|
|00000570| 63 20 63 68 61 72 09 53 | 43 43 53 69 64 5b 5d 20 |c char.S|CCSid[] |
|00000580| 3d 20 22 40 28 23 29 61 | 6c 6c 6f 63 61 2e 63 09 |= "@(#)a|lloca.c.|
|00000590| 31 2e 31 22 3b 09 2f 2a | 20 66 6f 72 20 74 68 65 |1.1";./*| for the|
|000005a0| 20 22 77 68 61 74 22 20 | 75 74 69 6c 69 74 79 20 | "what" |utility |
|000005b0| 2a 2f 0d 23 65 6e 64 69 | 66 0d 0d 23 69 66 64 65 |*/.#endi|f..#ifde|
|000005c0| 66 20 65 6d 61 63 73 0d | 23 69 6e 63 6c 75 64 65 |f emacs.|#include|
|000005d0| 20 22 63 6f 6e 66 69 67 | 2e 68 22 0d 23 69 66 64 | "config|.h".#ifd|
|000005e0| 65 66 20 73 74 61 74 69 | 63 0d 2f 2a 20 61 63 74 |ef stati|c./* act|
|000005f0| 75 61 6c 6c 79 2c 20 6f | 6e 6c 79 20 77 61 6e 74 |ually, o|nly want|
|00000600| 20 74 68 69 73 20 69 66 | 20 73 74 61 74 69 63 20 | this if| static |
|00000610| 69 73 20 64 65 66 69 6e | 65 64 20 61 73 20 22 22 |is defin|ed as ""|
|00000620| 0d 20 20 20 2d 2d 20 74 | 68 69 73 20 69 73 20 66 |. -- t|his is f|
|00000630| 6f 72 20 75 73 67 2c 20 | 69 6e 20 77 68 69 63 68 |or usg, |in which|
|00000640| 20 65 6d 61 63 73 20 6d | 75 73 74 20 75 6e 64 65 | emacs m|ust unde|
|00000650| 66 69 6e 65 20 73 74 61 | 74 69 63 0d 20 20 20 69 |fine sta|tic. i|
|00000660| 6e 20 6f 72 64 65 72 20 | 74 6f 20 6d 61 6b 65 20 |n order |to make |
|00000670| 75 6e 65 78 65 63 20 77 | 6f 72 6b 61 62 6c 65 0d |unexec w|orkable.|
|00000680| 20 20 20 2a 2f 0d 23 69 | 66 6e 64 65 66 20 53 54 | */.#i|fndef ST|
|00000690| 41 43 4b 5f 44 49 52 45 | 43 54 49 4f 4e 0d 79 6f |ACK_DIRE|CTION.yo|
|000006a0| 75 0d 6c 6f 73 65 0d 2d | 2d 20 6d 75 73 74 20 6b |u.lose.-|- must k|
|000006b0| 6e 6f 77 20 53 54 41 43 | 4b 5f 44 49 52 45 43 54 |now STAC|K_DIRECT|
|000006c0| 49 4f 4e 20 61 74 20 63 | 6f 6d 70 69 6c 65 2d 74 |ION at c|ompile-t|
|000006d0| 69 6d 65 0d 23 65 6e 64 | 69 66 20 2f 2a 20 53 54 |ime.#end|if /* ST|
|000006e0| 41 43 4b 5f 44 49 52 45 | 43 54 49 4f 4e 20 75 6e |ACK_DIRE|CTION un|
|000006f0| 64 65 66 69 6e 65 64 20 | 2a 2f 0d 23 65 6e 64 69 |defined |*/.#endi|
|00000700| 66 20 73 74 61 74 69 63 | 0d 23 65 6e 64 69 66 20 |f static|.#endif |
|00000710| 65 6d 61 63 73 0d 0d 23 | 69 66 64 65 66 20 58 33 |emacs..#|ifdef X3|
|00000720| 4a 31 31 0d 74 79 70 65 | 64 65 66 20 76 6f 69 64 |J11.type|def void|
|00000730| 09 2a 70 6f 69 6e 74 65 | 72 3b 09 09 2f 2a 20 67 |.*pointe|r;../* g|
|00000740| 65 6e 65 72 69 63 20 70 | 6f 69 6e 74 65 72 20 74 |eneric p|ointer t|
|00000750| 79 70 65 20 2a 2f 0d 23 | 65 6c 73 65 0d 74 79 70 |ype */.#|else.typ|
|00000760| 65 64 65 66 20 63 68 61 | 72 09 2a 70 6f 69 6e 74 |edef cha|r.*point|
|00000770| 65 72 3b 09 09 2f 2a 20 | 67 65 6e 65 72 69 63 20 |er;../* |generic |
|00000780| 70 6f 69 6e 74 65 72 20 | 74 79 70 65 20 2a 2f 0d |pointer |type */.|
|00000790| 23 65 6e 64 69 66 0d 0d | 23 64 65 66 69 6e 65 09 |#endif..|#define.|
|000007a0| 4e 55 4c 4c 09 30 09 09 | 09 2f 2a 20 6e 75 6c 6c |NULL.0..|./* null|
|000007b0| 20 70 6f 69 6e 74 65 72 | 20 63 6f 6e 73 74 61 6e | pointer| constan|
|000007c0| 74 20 2a 2f 0d 0d 65 78 | 74 65 72 6e 20 76 6f 69 |t */..ex|tern voi|
|000007d0| 64 09 66 72 65 65 28 29 | 3b 0d 65 78 74 65 72 6e |d.free()|;.extern|
|000007e0| 20 70 6f 69 6e 74 65 72 | 09 78 6d 61 6c 6c 6f 63 | pointer|.xmalloc|
|000007f0| 28 29 3b 0d 0d 2f 2a 0d | 09 44 65 66 69 6e 65 20 |();../*.|.Define |
|00000800| 53 54 41 43 4b 5f 44 49 | 52 45 43 54 49 4f 4e 20 |STACK_DI|RECTION |
|00000810| 69 66 20 79 6f 75 20 6b | 6e 6f 77 20 74 68 65 20 |if you k|now the |
|00000820| 64 69 72 65 63 74 69 6f | 6e 20 6f 66 20 73 74 61 |directio|n of sta|
|00000830| 63 6b 0d 09 67 72 6f 77 | 74 68 20 66 6f 72 20 79 |ck..grow|th for y|
|00000840| 6f 75 72 20 73 79 73 74 | 65 6d 3b 20 6f 74 68 65 |our syst|em; othe|
|00000850| 72 77 69 73 65 20 69 74 | 20 77 69 6c 6c 20 62 65 |rwise it| will be|
|00000860| 20 61 75 74 6f 6d 61 74 | 69 63 61 6c 6c 79 0d 09 | automat|ically..|
|00000870| 64 65 64 75 63 65 64 20 | 61 74 20 72 75 6e 2d 74 |deduced |at run-t|
|00000880| 69 6d 65 2e 0d 0d 09 53 | 54 41 43 4b 5f 44 49 52 |ime....S|TACK_DIR|
|00000890| 45 43 54 49 4f 4e 20 3e | 20 30 20 3d 3e 20 67 72 |ECTION >| 0 => gr|
|000008a0| 6f 77 73 20 74 6f 77 61 | 72 64 20 68 69 67 68 65 |ows towa|rd highe|
|000008b0| 72 20 61 64 64 72 65 73 | 73 65 73 0d 09 53 54 41 |r addres|ses..STA|
|000008c0| 43 4b 5f 44 49 52 45 43 | 54 49 4f 4e 20 3c 20 30 |CK_DIREC|TION < 0|
|000008d0| 20 3d 3e 20 67 72 6f 77 | 73 20 74 6f 77 61 72 64 | => grow|s toward|
|000008e0| 20 6c 6f 77 65 72 20 61 | 64 64 72 65 73 73 65 73 | lower a|ddresses|
|000008f0| 0d 09 53 54 41 43 4b 5f | 44 49 52 45 43 54 49 4f |..STACK_|DIRECTIO|
|00000900| 4e 20 3d 20 30 20 3d 3e | 20 64 69 72 65 63 74 69 |N = 0 =>| directi|
|00000910| 6f 6e 20 6f 66 20 67 72 | 6f 77 74 68 20 75 6e 6b |on of gr|owth unk|
|00000920| 6e 6f 77 6e 0d 2a 2f 0d | 0d 23 69 66 6e 64 65 66 |nown.*/.|.#ifndef|
|00000930| 20 53 54 41 43 4b 5f 44 | 49 52 45 43 54 49 4f 4e | STACK_D|IRECTION|
|00000940| 0d 23 64 65 66 69 6e 65 | 09 53 54 41 43 4b 5f 44 |.#define|.STACK_D|
|00000950| 49 52 45 43 54 49 4f 4e | 09 30 09 09 2f 2a 20 64 |IRECTION|.0../* d|
|00000960| 69 72 65 63 74 69 6f 6e | 20 75 6e 6b 6e 6f 77 6e |irection| unknown|
|00000970| 20 2a 2f 0d 23 65 6e 64 | 69 66 0d 0d 23 69 66 20 | */.#end|if..#if |
|00000980| 53 54 41 43 4b 5f 44 49 | 52 45 43 54 49 4f 4e 20 |STACK_DI|RECTION |
|00000990| 21 3d 20 30 0d 0d 23 64 | 65 66 69 6e 65 09 53 54 |!= 0..#d|efine.ST|
|000009a0| 41 43 4b 5f 44 49 52 09 | 53 54 41 43 4b 5f 44 49 |ACK_DIR.|STACK_DI|
|000009b0| 52 45 43 54 49 4f 4e 09 | 2f 2a 20 6b 6e 6f 77 6e |RECTION.|/* known|
|000009c0| 20 61 74 20 63 6f 6d 70 | 69 6c 65 2d 74 69 6d 65 | at comp|ile-time|
|000009d0| 20 2a 2f 0d 0d 23 65 6c | 73 65 09 2f 2a 20 53 54 | */..#el|se./* ST|
|000009e0| 41 43 4b 5f 44 49 52 45 | 43 54 49 4f 4e 20 3d 3d |ACK_DIRE|CTION ==|
|000009f0| 20 30 3b 20 6e 65 65 64 | 20 72 75 6e 2d 74 69 6d | 0; need| run-tim|
|00000a00| 65 20 63 6f 64 65 20 2a | 2f 0d 0d 73 74 61 74 69 |e code *|/..stati|
|00000a10| 63 20 69 6e 74 09 73 74 | 61 63 6b 5f 64 69 72 3b |c int.st|ack_dir;|
|00000a20| 09 09 2f 2a 20 31 20 6f | 72 20 2d 31 20 6f 6e 63 |../* 1 o|r -1 onc|
|00000a30| 65 20 6b 6e 6f 77 6e 20 | 2a 2f 0d 23 64 65 66 69 |e known |*/.#defi|
|00000a40| 6e 65 09 53 54 41 43 4b | 5f 44 49 52 09 73 74 61 |ne.STACK|_DIR.sta|
|00000a50| 63 6b 5f 64 69 72 0d 0d | 73 74 61 74 69 63 20 76 |ck_dir..|static v|
|00000a60| 6f 69 64 0d 66 69 6e 64 | 5f 73 74 61 63 6b 5f 64 |oid.find|_stack_d|
|00000a70| 69 72 65 63 74 69 6f 6e | 20 28 2f 2a 20 76 6f 69 |irection| (/* voi|
|00000a80| 64 20 2a 2f 29 0d 7b 0d | 20 20 73 74 61 74 69 63 |d */).{.| static|
|00000a90| 20 63 68 61 72 09 2a 61 | 64 64 72 20 3d 20 4e 55 | char.*a|ddr = NU|
|00000aa0| 4c 4c 3b 09 2f 2a 20 61 | 64 64 72 65 73 73 20 6f |LL;./* a|ddress o|
|00000ab0| 66 20 66 69 72 73 74 0d | 09 09 09 09 20 20 20 60 |f first.|.... `|
|00000ac0| 64 75 6d 6d 79 27 2c 20 | 6f 6e 63 65 20 6b 6e 6f |dummy', |once kno|
|00000ad0| 77 6e 20 2a 2f 0d 20 20 | 61 75 74 6f 20 63 68 61 |wn */. |auto cha|
|00000ae0| 72 09 64 75 6d 6d 79 3b | 09 09 2f 2a 20 74 6f 20 |r.dummy;|../* to |
|00000af0| 67 65 74 20 73 74 61 63 | 6b 20 61 64 64 72 65 73 |get stac|k addres|
|00000b00| 73 20 2a 2f 0d 0d 20 20 | 69 66 20 28 61 64 64 72 |s */.. |if (addr|
|00000b10| 20 3d 3d 20 4e 55 4c 4c | 29 0d 20 20 20 20 7b 09 | == NULL|). {.|
|00000b20| 09 09 09 2f 2a 20 69 6e | 69 74 69 61 6c 20 65 6e |.../* in|itial en|
|00000b30| 74 72 79 20 2a 2f 0d 20 | 20 20 20 20 20 61 64 64 |try */. | add|
|00000b40| 72 20 3d 20 26 64 75 6d | 6d 79 3b 0d 0d 20 20 20 |r = &dum|my;.. |
|00000b50| 20 20 20 66 69 6e 64 5f | 73 74 61 63 6b 5f 64 69 | find_|stack_di|
|00000b60| 72 65 63 74 69 6f 6e 20 | 28 29 3b 09 2f 2a 20 72 |rection |();./* r|
|00000b70| 65 63 75 72 73 65 20 6f | 6e 63 65 20 2a 2f 0d 20 |ecurse o|nce */. |
|00000b80| 20 20 20 7d 0d 20 20 65 | 6c 73 65 09 09 09 09 2f | }. e|lse..../|
|00000b90| 2a 20 73 65 63 6f 6e 64 | 20 65 6e 74 72 79 20 2a |* second| entry *|
|00000ba0| 2f 0d 20 20 20 20 69 66 | 20 28 26 64 75 6d 6d 79 |/. if| (&dummy|
|00000bb0| 20 3e 20 61 64 64 72 29 | 0d 20 20 20 20 20 20 73 | > addr)|. s|
|00000bc0| 74 61 63 6b 5f 64 69 72 | 20 3d 20 31 3b 09 09 2f |tack_dir| = 1;../|
|00000bd0| 2a 20 73 74 61 63 6b 20 | 67 72 65 77 20 75 70 77 |* stack |grew upw|
|00000be0| 61 72 64 20 2a 2f 0d 20 | 20 20 20 65 6c 73 65 0d |ard */. | else.|
|00000bf0| 20 20 20 20 20 20 73 74 | 61 63 6b 5f 64 69 72 20 | st|ack_dir |
|00000c00| 3d 20 2d 31 3b 09 09 2f | 2a 20 73 74 61 63 6b 20 |= -1;../|* stack |
|00000c10| 67 72 65 77 20 64 6f 77 | 6e 77 61 72 64 20 2a 2f |grew dow|nward */|
|00000c20| 0d 7d 0d 0d 23 65 6e 64 | 69 66 09 2f 2a 20 53 54 |.}..#end|if./* ST|
|00000c30| 41 43 4b 5f 44 49 52 45 | 43 54 49 4f 4e 20 3d 3d |ACK_DIRE|CTION ==|
|00000c40| 20 30 20 2a 2f 0d 0d 2f | 2a 0d 09 41 6e 20 22 61 | 0 */../|*..An "a|
|00000c50| 6c 6c 6f 63 61 20 68 65 | 61 64 65 72 22 20 69 73 |lloca he|ader" is|
|00000c60| 20 75 73 65 64 20 74 6f | 3a 0d 09 28 61 29 20 63 | used to|:..(a) c|
|00000c70| 68 61 69 6e 20 74 6f 67 | 65 74 68 65 72 20 61 6c |hain tog|ether al|
|00000c80| 6c 20 61 6c 6c 6f 63 61 | 28 29 65 64 20 62 6c 6f |l alloca|()ed blo|
|00000c90| 63 6b 73 3b 0d 09 28 62 | 29 20 6b 65 65 70 20 74 |cks;..(b|) keep t|
|00000ca0| 72 61 63 6b 20 6f 66 20 | 73 74 61 63 6b 20 64 65 |rack of |stack de|
|00000cb0| 70 74 68 2e 0d 0d 09 49 | 74 20 69 73 20 76 65 72 |pth....I|t is ver|
|00000cc0| 79 20 69 6d 70 6f 72 74 | 61 6e 74 20 74 68 61 74 |y import|ant that|
|00000cd0| 20 73 69 7a 65 6f 66 28 | 68 65 61 64 65 72 29 20 | sizeof(|header) |
|00000ce0| 61 67 72 65 65 20 77 69 | 74 68 20 6d 61 6c 6c 6f |agree wi|th mallo|
|00000cf0| 63 28 29 0d 09 61 6c 69 | 67 6e 6d 65 6e 74 20 63 |c()..ali|gnment c|
|00000d00| 68 75 6e 6b 20 73 69 7a | 65 2e 20 20 54 68 65 20 |hunk siz|e. The |
|00000d10| 66 6f 6c 6c 6f 77 69 6e | 67 20 64 65 66 61 75 6c |followin|g defaul|
|00000d20| 74 20 73 68 6f 75 6c 64 | 20 77 6f 72 6b 20 6f 6b |t should| work ok|
|00000d30| 61 79 2e 0d 2a 2f 0d 0d | 23 69 66 6e 64 65 66 09 |ay..*/..|#ifndef.|
|00000d40| 41 4c 49 47 4e 5f 53 49 | 5a 45 0d 23 64 65 66 69 |ALIGN_SI|ZE.#defi|
|00000d50| 6e 65 09 41 4c 49 47 4e | 5f 53 49 5a 45 09 73 69 |ne.ALIGN|_SIZE.si|
|00000d60| 7a 65 6f 66 28 64 6f 75 | 62 6c 65 29 0d 23 65 6e |zeof(dou|ble).#en|
|00000d70| 64 69 66 0d 0d 74 79 70 | 65 64 65 66 20 75 6e 69 |dif..typ|edef uni|
|00000d80| 6f 6e 20 68 64 72 0d 7b | 0d 20 20 63 68 61 72 09 |on hdr.{|. char.|
|00000d90| 61 6c 69 67 6e 5b 41 4c | 49 47 4e 5f 53 49 5a 45 |align[AL|IGN_SIZE|
|00000da0| 5d 3b 09 2f 2a 20 74 6f | 20 66 6f 72 63 65 20 73 |];./* to| force s|
|00000db0| 69 7a 65 6f 66 28 68 65 | 61 64 65 72 29 20 2a 2f |izeof(he|ader) */|
|00000dc0| 0d 20 20 73 74 72 75 63 | 74 0d 20 20 20 20 7b 0d |. struc|t. {.|
|00000dd0| 20 20 20 20 20 20 75 6e | 69 6f 6e 20 68 64 72 20 | un|ion hdr |
|00000de0| 2a 6e 65 78 74 3b 09 09 | 2f 2a 20 66 6f 72 20 63 |*next;..|/* for c|
|00000df0| 68 61 69 6e 69 6e 67 20 | 68 65 61 64 65 72 73 20 |haining |headers |
|00000e00| 2a 2f 0d 20 20 20 20 20 | 20 63 68 61 72 20 2a 64 |*/. | char *d|
|00000e10| 65 65 70 3b 09 09 2f 2a | 20 66 6f 72 20 73 74 61 |eep;../*| for sta|
|00000e20| 63 6b 20 64 65 70 74 68 | 20 6d 65 61 73 75 72 65 |ck depth| measure|
|00000e30| 20 2a 2f 0d 20 20 20 20 | 7d 20 68 3b 0d 7d 20 68 | */. |} h;.} h|
|00000e40| 65 61 64 65 72 3b 0d 0d | 2f 2a 0d 09 61 6c 6c 6f |eader;..|/*..allo|
|00000e50| 63 61 28 20 73 69 7a 65 | 20 29 20 72 65 74 75 72 |ca( size| ) retur|
|00000e60| 6e 73 20 61 20 70 6f 69 | 6e 74 65 72 20 74 6f 20 |ns a poi|nter to |
|00000e70| 61 74 20 6c 65 61 73 74 | 20 60 73 69 7a 65 27 20 |at least| `size' |
|00000e80| 62 79 74 65 73 20 6f 66 | 0d 09 73 74 6f 72 61 67 |bytes of|..storag|
|00000e90| 65 20 77 68 69 63 68 20 | 77 69 6c 6c 20 62 65 20 |e which |will be |
|00000ea0| 61 75 74 6f 6d 61 74 69 | 63 61 6c 6c 79 20 72 65 |automati|cally re|
|00000eb0| 63 6c 61 69 6d 65 64 20 | 75 70 6f 6e 20 65 78 69 |claimed |upon exi|
|00000ec0| 74 20 66 72 6f 6d 0d 09 | 74 68 65 20 70 72 6f 63 |t from..|the proc|
|00000ed0| 65 64 75 72 65 20 74 68 | 61 74 20 63 61 6c 6c 65 |edure th|at calle|
|00000ee0| 64 20 61 6c 6c 6f 63 61 | 28 29 2e 20 20 4f 72 69 |d alloca|(). Ori|
|00000ef0| 67 69 6e 61 6c 6c 79 2c | 20 74 68 69 73 20 73 70 |ginally,| this sp|
|00000f00| 61 63 65 0d 09 77 61 73 | 20 73 75 70 70 6f 73 65 |ace..was| suppose|
|00000f10| 64 20 74 6f 20 62 65 20 | 74 61 6b 65 6e 20 66 72 |d to be |taken fr|
|00000f20| 6f 6d 20 74 68 65 20 63 | 75 72 72 65 6e 74 20 73 |om the c|urrent s|
|00000f30| 74 61 63 6b 20 66 72 61 | 6d 65 20 6f 66 20 74 68 |tack fra|me of th|
|00000f40| 65 0d 09 63 61 6c 6c 65 | 72 2c 20 62 75 74 20 74 |e..calle|r, but t|
|00000f50| 68 61 74 20 6d 65 74 68 | 6f 64 20 63 61 6e 6e 6f |hat meth|od canno|
|00000f60| 74 20 62 65 20 6d 61 64 | 65 20 74 6f 20 77 6f 72 |t be mad|e to wor|
|00000f70| 6b 20 66 6f 72 20 73 6f | 6d 65 0d 09 69 6d 70 6c |k for so|me..impl|
|00000f80| 65 6d 65 6e 74 61 74 69 | 6f 6e 73 20 6f 66 20 43 |ementati|ons of C|
|00000f90| 2c 20 66 6f 72 20 65 78 | 61 6d 70 6c 65 20 75 6e |, for ex|ample un|
|00000fa0| 64 65 72 20 47 6f 75 6c | 64 27 73 20 55 54 58 2f |der Goul|d's UTX/|
|00000fb0| 33 32 2e 0d 2a 2f 0d 0d | 73 74 61 74 69 63 20 68 |32..*/..|static h|
|00000fc0| 65 61 64 65 72 20 2a 6c | 61 73 74 5f 61 6c 6c 6f |eader *l|ast_allo|
|00000fd0| 63 61 5f 68 65 61 64 65 | 72 20 3d 20 4e 55 4c 4c |ca_heade|r = NULL|
|00000fe0| 3b 20 2f 2a 20 2d 3e 20 | 6c 61 73 74 20 61 6c 6c |; /* -> |last all|
|00000ff0| 6f 63 61 20 68 65 61 64 | 65 72 20 2a 2f 0d 23 69 |oca head|er */.#i|
|00001000| 66 64 65 66 20 4d 50 57 | 0d 2f 2a 20 4d 50 57 20 |fdef MPW|./* MPW |
|00001010| 43 20 70 6c 61 79 73 20 | 67 61 6d 65 73 20 77 69 |C plays |games wi|
|00001020| 74 68 20 74 68 65 20 73 | 74 61 63 6b 20 70 6f 69 |th the s|tack poi|
|00001030| 6e 74 65 72 2c 20 69 6e | 20 6d 75 63 68 20 74 68 |nter, in| much th|
|00001040| 65 20 73 61 6d 65 20 77 | 61 79 20 74 68 61 74 20 |e same w|ay that |
|00001050| 47 43 43 0d 20 20 20 64 | 6f 65 73 2c 20 62 75 74 |GCC. d|oes, but|
|00001060| 20 75 6e 66 6f 72 74 75 | 6e 61 74 65 6c 79 20 69 | unfortu|nately i|
|00001070| 74 20 63 61 6e 27 74 20 | 62 65 20 74 6f 6c 64 20 |t can't |be told |
|00001080| 74 6f 20 62 65 20 63 61 | 72 65 66 75 6c 20 61 72 |to be ca|reful ar|
|00001090| 6f 75 6e 64 20 61 6c 6c | 6f 63 61 2e 0d 20 20 20 |ound all|oca.. |
|000010a0| 53 6f 20 69 6e 73 74 65 | 61 64 20 6f 66 20 6c 6f |So inste|ad of lo|
|000010b0| 6f 6b 69 6e 67 20 61 74 | 20 73 70 2c 20 77 65 20 |oking at| sp, we |
|000010c0| 6c 6f 6f 6b 20 61 74 20 | 74 68 65 20 66 72 61 6d |look at |the fram|
|000010d0| 65 20 70 6f 69 6e 74 65 | 72 20 6f 66 20 61 6c 6c |e pointe|r of all|
|000010e0| 6f 63 61 27 73 0d 20 20 | 20 63 61 6c 6c 65 72 2c |oca's. | caller,|
|000010f0| 20 77 68 69 63 68 20 69 | 73 20 6b 6e 6f 77 6e 20 | which i|s known |
|00001100| 74 6f 20 61 6c 77 61 79 | 73 20 62 65 20 64 65 66 |to alway|s be def|
|00001110| 69 6e 65 64 20 61 6e 64 | 20 6e 6f 74 20 74 6f 20 |ined and| not to |
|00001120| 63 68 61 6e 67 65 20 77 | 69 74 68 69 6e 0d 20 20 |change w|ithin. |
|00001130| 20 69 74 73 20 73 63 6f | 70 65 20 6f 66 20 64 65 | its sco|pe of de|
|00001140| 66 69 6e 69 74 69 6f 6e | 2e 20 20 44 6f 69 6e 67 |finition|. Doing|
|00001150| 20 74 68 69 73 20 72 65 | 71 75 69 72 65 73 20 61 | this re|quires a|
|00001160| 20 64 69 72 65 63 74 20 | 66 75 6e 63 74 69 6f 6e | direct |function|
|00001170| 20 74 68 61 74 0d 20 20 | 20 70 69 63 6b 73 20 75 | that. | picks u|
|00001180| 70 20 74 68 65 20 63 61 | 6c 6c 65 72 27 73 20 61 |p the ca|ller's a|
|00001190| 36 2c 20 75 73 69 6e 67 | 20 74 68 65 20 73 69 6e |6, using| the sin|
|000011a0| 67 6c 65 20 69 6e 73 74 | 72 75 63 74 69 6f 6e 20 |gle inst|ruction |
|000011b0| 22 6d 6f 76 65 2e 6c 20 | 28 61 36 29 2c 64 30 22 |"move.l |(a6),d0"|
|000011c0| 2e 20 2a 2f 0d 20 20 20 | 0d 73 74 61 74 69 63 20 |. */. |.static |
|000011d0| 63 68 61 72 20 2a 66 72 | 61 6d 65 5f 70 6f 69 6e |char *fr|ame_poin|
|000011e0| 74 65 72 5f 76 61 6c 75 | 65 28 29 20 3d 20 30 78 |ter_valu|e() = 0x|
|000011f0| 32 30 31 36 3b 0d 23 65 | 6e 64 69 66 20 2f 2a 20 |2016;.#e|ndif /* |
|00001200| 4d 50 57 20 2a 2f 0d 23 | 69 66 64 65 66 20 4d 50 |MPW */.#|ifdef MP|
|00001210| 57 0d 2f 2a 20 54 68 69 | 73 20 76 61 72 69 61 62 |W./* Thi|s variab|
|00001220| 6c 65 20 6a 75 73 74 20 | 6b 65 65 70 73 20 74 72 |le just |keeps tr|
|00001230| 61 63 6b 20 6f 66 20 6d | 75 63 68 20 61 6c 6c 6f |ack of m|uch allo|
|00001240| 63 61 20 69 73 20 75 73 | 65 64 2e 20 2a 2f 0d 69 |ca is us|ed. */.i|
|00001250| 6e 74 20 74 6f 74 61 6c | 6c 6f 63 61 20 3d 20 30 |nt total|loca = 0|
|00001260| 3b 0d 23 65 6e 64 69 66 | 20 2f 2a 20 4d 50 57 20 |;.#endif| /* MPW |
|00001270| 2a 2f 0d 0d 70 6f 69 6e | 74 65 72 0d 61 6c 6c 6f |*/..poin|ter.allo|
|00001280| 63 61 20 28 73 69 7a 65 | 29 09 09 09 2f 2a 20 72 |ca (size|).../* r|
|00001290| 65 74 75 72 6e 73 20 70 | 6f 69 6e 74 65 72 20 74 |eturns p|ointer t|
|000012a0| 6f 20 73 74 6f 72 61 67 | 65 20 2a 2f 0d 20 20 20 |o storag|e */. |
|000012b0| 20 20 75 6e 73 69 67 6e | 65 64 09 73 69 7a 65 3b | unsign|ed.size;|
|000012c0| 09 09 2f 2a 20 23 20 62 | 79 74 65 73 20 74 6f 20 |../* # b|ytes to |
|000012d0| 61 6c 6c 6f 63 61 74 65 | 20 2a 2f 0d 7b 0d 23 69 |allocate| */.{.#i|
|000012e0| 66 64 65 66 20 4d 50 57 | 0d 20 20 2f 2a 20 55 73 |fdef MPW|. /* Us|
|000012f0| 65 20 74 68 65 20 63 61 | 6c 6c 65 72 27 73 20 66 |e the ca|ller's f|
|00001300| 72 61 6d 65 20 70 6f 69 | 6e 74 65 72 20 74 6f 20 |rame poi|nter to |
|00001310| 65 73 74 69 6d 61 74 65 | 20 64 65 70 74 68 20 69 |estimate| depth i|
|00001320| 6e 20 74 68 65 20 73 74 | 61 63 6b 2e 20 2a 2f 0d |n the st|ack. */.|
|00001330| 20 20 72 65 67 69 73 74 | 65 72 20 63 68 61 72 20 | regist|er char |
|00001340| 2a 64 65 70 74 68 20 3d | 20 66 72 61 6d 65 5f 70 |*depth =| frame_p|
|00001350| 6f 69 6e 74 65 72 5f 76 | 61 6c 75 65 28 29 3b 0d |ointer_v|alue();.|
|00001360| 23 65 6c 73 65 0d 20 20 | 61 75 74 6f 20 63 68 61 |#else. |auto cha|
|00001370| 72 09 70 72 6f 62 65 3b | 09 09 2f 2a 20 70 72 6f |r.probe;|../* pro|
|00001380| 62 65 73 20 73 74 61 63 | 6b 20 64 65 70 74 68 3a |bes stac|k depth:|
|00001390| 20 2a 2f 0d 20 20 72 65 | 67 69 73 74 65 72 20 63 | */. re|gister c|
|000013a0| 68 61 72 09 2a 64 65 70 | 74 68 20 3d 20 26 70 72 |har.*dep|th = &pr|
|000013b0| 6f 62 65 3b 0d 23 65 6e | 64 69 66 20 2f 2a 20 4d |obe;.#en|dif /* M|
|000013c0| 50 57 20 2a 2f 0d 23 69 | 66 64 65 66 20 4d 50 57 |PW */.#i|fdef MPW|
|000013d0| 0d 20 20 2f 2a 20 43 6f | 75 6e 74 20 74 68 69 73 |. /* Co|unt this|
|000013e0| 20 63 61 6c 6c 20 61 67 | 61 69 6e 73 74 20 74 68 | call ag|ainst th|
|000013f0| 65 20 74 6f 74 61 6c 20 | 61 6c 6c 6f 63 61 74 69 |e total |allocati|
|00001400| 6f 6e 2e 20 2a 2f 0d 20 | 20 74 6f 74 61 6c 6c 6f |on. */. | totallo|
|00001410| 63 61 20 2b 3d 20 73 69 | 7a 65 3b 0d 23 65 6e 64 |ca += si|ze;.#end|
|00001420| 69 66 20 2f 2a 20 4d 50 | 57 20 2a 2f 0d 0d 23 69 |if /* MP|W */..#i|
|00001430| 66 20 53 54 41 43 4b 5f | 44 49 52 45 43 54 49 4f |f STACK_|DIRECTIO|
|00001440| 4e 20 3d 3d 20 30 0d 20 | 20 69 66 20 28 53 54 41 |N == 0. | if (STA|
|00001450| 43 4b 5f 44 49 52 20 3d | 3d 20 30 29 09 09 2f 2a |CK_DIR =|= 0)../*|
|00001460| 20 75 6e 6b 6e 6f 77 6e | 20 67 72 6f 77 74 68 20 | unknown| growth |
|00001470| 64 69 72 65 63 74 69 6f | 6e 20 2a 2f 0d 20 20 20 |directio|n */. |
|00001480| 20 66 69 6e 64 5f 73 74 | 61 63 6b 5f 64 69 72 65 | find_st|ack_dire|
|00001490| 63 74 69 6f 6e 20 28 29 | 3b 0d 23 65 6e 64 69 66 |ction ()|;.#endif|
|000014a0| 0d 0d 09 09 09 09 2f 2a | 20 52 65 63 6c 61 69 6d |....../*| Reclaim|
|000014b0| 20 67 61 72 62 61 67 65 | 2c 20 64 65 66 69 6e 65 | garbage|, define|
|000014c0| 64 20 61 73 20 61 6c 6c | 20 61 6c 6c 6f 63 61 28 |d as all| alloca(|
|000014d0| 29 65 64 20 73 74 6f 72 | 61 67 65 20 74 68 61 74 |)ed stor|age that|
|000014e0| 0d 09 09 09 09 20 20 20 | 77 61 73 20 61 6c 6c 6f |..... |was allo|
|000014f0| 63 61 74 65 64 20 66 72 | 6f 6d 20 64 65 65 70 65 |cated fr|om deepe|
|00001500| 72 20 69 6e 20 74 68 65 | 20 73 74 61 63 6b 20 74 |r in the| stack t|
|00001510| 68 61 6e 20 63 75 72 72 | 65 6e 74 6c 79 2e 20 2a |han curr|ently. *|
|00001520| 2f 0d 0d 20 20 7b 0d 20 | 20 20 20 72 65 67 69 73 |/.. {. | regis|
|00001530| 74 65 72 20 68 65 61 64 | 65 72 09 2a 68 70 3b 09 |ter head|er.*hp;.|
|00001540| 2f 2a 20 74 72 61 76 65 | 72 73 65 73 20 6c 69 6e |/* trave|rses lin|
|00001550| 6b 65 64 20 6c 69 73 74 | 20 2a 2f 0d 0d 20 20 20 |ked list| */.. |
|00001560| 20 66 6f 72 20 28 68 70 | 20 3d 20 6c 61 73 74 5f | for (hp| = last_|
|00001570| 61 6c 6c 6f 63 61 5f 68 | 65 61 64 65 72 3b 20 68 |alloca_h|eader; h|
|00001580| 70 20 21 3d 20 4e 55 4c | 4c 3b 29 0d 20 20 20 20 |p != NUL|L;). |
|00001590| 20 20 69 66 20 28 53 54 | 41 43 4b 5f 44 49 52 20 | if (ST|ACK_DIR |
|000015a0| 3e 20 30 20 26 26 20 68 | 70 2d 3e 68 2e 64 65 65 |> 0 && h|p->h.dee|
|000015b0| 70 20 3e 20 64 65 70 74 | 68 0d 09 20 20 7c 7c 20 |p > dept|h.. || |
|000015c0| 53 54 41 43 4b 5f 44 49 | 52 20 3c 20 30 20 26 26 |STACK_DI|R < 0 &&|
|000015d0| 20 68 70 2d 3e 68 2e 64 | 65 65 70 20 3c 20 64 65 | hp->h.d|eep < de|
|000015e0| 70 74 68 29 0d 09 7b 0d | 09 20 20 72 65 67 69 73 |pth)..{.|. regis|
|000015f0| 74 65 72 20 68 65 61 64 | 65 72 09 2a 6e 70 20 3d |ter head|er.*np =|
|00001600| 20 68 70 2d 3e 68 2e 6e | 65 78 74 3b 0d 0d 09 20 | hp->h.n|ext;... |
|00001610| 20 66 72 65 65 20 28 28 | 70 6f 69 6e 74 65 72 29 | free ((|pointer)|
|00001620| 20 68 70 29 3b 09 2f 2a | 20 63 6f 6c 6c 65 63 74 | hp);./*| collect|
|00001630| 20 67 61 72 62 61 67 65 | 20 2a 2f 0d 0d 09 20 20 | garbage| */... |
|00001640| 68 70 20 3d 20 6e 70 3b | 09 09 2f 2a 20 2d 3e 20 |hp = np;|../* -> |
|00001650| 6e 65 78 74 20 68 65 61 | 64 65 72 20 2a 2f 0d 09 |next hea|der */..|
|00001660| 7d 0d 20 20 20 20 20 20 | 65 6c 73 65 0d 09 62 72 |}. |else..br|
|00001670| 65 61 6b 3b 09 09 09 2f | 2a 20 72 65 73 74 20 61 |eak;.../|* rest a|
|00001680| 72 65 20 6e 6f 74 20 64 | 65 65 70 65 72 20 2a 2f |re not d|eeper */|
|00001690| 0d 0d 20 20 20 20 6c 61 | 73 74 5f 61 6c 6c 6f 63 |.. la|st_alloc|
|000016a0| 61 5f 68 65 61 64 65 72 | 20 3d 20 68 70 3b 09 2f |a_header| = hp;./|
|000016b0| 2a 20 2d 3e 20 6c 61 73 | 74 20 76 61 6c 69 64 20 |* -> las|t valid |
|000016c0| 73 74 6f 72 61 67 65 20 | 2a 2f 0d 20 20 7d 0d 0d |storage |*/. }..|
|000016d0| 20 20 69 66 20 28 73 69 | 7a 65 20 3d 3d 20 30 29 | if (si|ze == 0)|
|000016e0| 0d 20 20 20 20 72 65 74 | 75 72 6e 20 4e 55 4c 4c |. ret|urn NULL|
|000016f0| 3b 09 09 2f 2a 20 6e 6f | 20 61 6c 6c 6f 63 61 74 |;../* no| allocat|
|00001700| 69 6f 6e 20 72 65 71 75 | 69 72 65 64 20 2a 2f 0d |ion requ|ired */.|
|00001710| 0d 20 20 2f 2a 20 41 6c | 6c 6f 63 61 74 65 20 63 |. /* Al|locate c|
|00001720| 6f 6d 62 69 6e 65 64 20 | 68 65 61 64 65 72 20 2b |ombined |header +|
|00001730| 20 75 73 65 72 20 64 61 | 74 61 20 73 74 6f 72 61 | user da|ta stora|
|00001740| 67 65 2e 20 2a 2f 0d 0d | 20 20 7b 0d 20 20 20 20 |ge. */..| {. |
|00001750| 72 65 67 69 73 74 65 72 | 20 70 6f 69 6e 74 65 72 |register| pointer|
|00001760| 09 6e 65 77 20 3d 20 78 | 6d 61 6c 6c 6f 63 20 28 |.new = x|malloc (|
|00001770| 73 69 7a 65 6f 66 20 28 | 68 65 61 64 65 72 29 20 |sizeof (|header) |
|00001780| 2b 20 73 69 7a 65 29 3b | 0d 20 20 20 20 2f 2a 20 |+ size);|. /* |
|00001790| 61 64 64 72 65 73 73 20 | 6f 66 20 68 65 61 64 65 |address |of heade|
|000017a0| 72 20 2a 2f 0d 0d 20 20 | 20 20 28 28 68 65 61 64 |r */.. | ((head|
|000017b0| 65 72 20 2a 29 6e 65 77 | 29 2d 3e 68 2e 6e 65 78 |er *)new|)->h.nex|
|000017c0| 74 20 3d 20 6c 61 73 74 | 5f 61 6c 6c 6f 63 61 5f |t = last|_alloca_|
|000017d0| 68 65 61 64 65 72 3b 0d | 20 20 20 20 28 28 68 65 |header;.| ((he|
|000017e0| 61 64 65 72 20 2a 29 6e | 65 77 29 2d 3e 68 2e 64 |ader *)n|ew)->h.d|
|000017f0| 65 65 70 20 3d 20 64 65 | 70 74 68 3b 0d 0d 20 20 |eep = de|pth;.. |
|00001800| 20 20 6c 61 73 74 5f 61 | 6c 6c 6f 63 61 5f 68 65 | last_a|lloca_he|
|00001810| 61 64 65 72 20 3d 20 28 | 68 65 61 64 65 72 20 2a |ader = (|header *|
|00001820| 29 6e 65 77 3b 0d 0d 20 | 20 20 20 2f 2a 20 55 73 |)new;.. | /* Us|
|00001830| 65 72 20 73 74 6f 72 61 | 67 65 20 62 65 67 69 6e |er stora|ge begin|
|00001840| 73 20 6a 75 73 74 20 61 | 66 74 65 72 20 68 65 61 |s just a|fter hea|
|00001850| 64 65 72 2e 20 2a 2f 0d | 0d 20 20 20 20 72 65 74 |der. */.|. ret|
|00001860| 75 72 6e 20 28 70 6f 69 | 6e 74 65 72 29 28 28 63 |urn (poi|nter)((c|
|00001870| 68 61 72 20 2a 29 6e 65 | 77 20 2b 20 73 69 7a 65 |har *)ne|w + size|
|00001880| 6f 66 28 68 65 61 64 65 | 72 29 29 3b 0d 20 20 7d |of(heade|r));. }|
|00001890| 0d 7d 0d 0d 00 00 00 00 | 00 00 00 00 00 00 00 00 |.}......|........|
|000018a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000018b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000018c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000018d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000018e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000018f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001900| 00 00 01 00 00 00 01 6e | 00 00 00 6e 00 00 00 3e |.......n|...n...>|
|00001910| 04 67 26 20 40 22 48 10 | 19 67 1e 12 11 12 c0 10 |.g& @"H.|.g......|
|00001920| 01 66 f8 93 c8 20 09 53 | 40 0c 80 00 00 00 ff 6f |.f... .S|@......o|
|00001930| 08 61 6c 6c 6f 63 61 2e | 63 6c 02 00 00 00 00 00 |.alloca.|cl......|
|00001940| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001950| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001960| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001970| 00 00 a3 81 52 08 00 00 | 00 00 00 00 01 ac 01 42 |....R...|.......B|
|00001980| 40 48 40 48 41 42 41 22 | 42 74 0f d2 81 d1 80 b3 |@H@HABA"|Bt......|
|00001990| c0 62 04 90 89 52 41 51 | ca ff f2 4e 75 2f 02 24 |.b...RAQ|...Nu/.$|
|000019a0| 01 22 00 4e ba ff b8 20 | 01 24 1f 4e 75 2f 02 24 |.".N... |.$.Nu/.$|
|000019b0| 01 22 00 70 00 4a 82 6c | 04 44 82 46 80 4a 81 6c |.".p.J.l|.D.F.J.l|
|000019c0| 04 44 81 46 80 20 40 4e | ba ff 94 24 08 67 02 44 |.D.F. @N|...$.g.D|
|000019d0| 81 20 01 24 1f 4e 75 00 | 00 01 00 7f ff ff f8 81 |. .$.Nu.|........|
|000019e0| 00 01 04 81 00 71 02 81 | 00 89 01 81 00 89 01 81 |.....q..|........|
|000019f0| 00 89 01 81 00 89 01 81 | 00 89 01 81 00 71 01 81 |........|.....q..|
|00001a00| 00 00 00 48 00 09 4d 6f | 6e 61 63 6f 00 00 00 18 |...H..Mo|naco....|
|00001a10| 00 00 00 14 00 01 a8 30 | 00 0a 00 0c 00 60 00 be |.......0|.....`..|
|00001a20| 01 d8 00 24 00 00 00 06 | 00 04 00 3c 00 24 01 dd |...$....|...<.$..|
|00001a30| 02 3d 00 3c 00 24 01 dd | 02 3d a2 2d 49 da 00 00 |.=.<.$..|.=.-I...|
|00001a40| 00 49 00 00 00 49 00 00 | 00 00 01 00 00 00 00 1e |.I...I..|........|
|00001a50| 00 3c 00 24 01 dd 02 3d | 00 3c 00 24 01 dd 02 3d |.<.$...=|.<.$...=|
|00001a60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001a70| 01 00 00 00 01 6e 00 00 | 00 6e 00 00 00 3e 00 16 |.....n..|.n...>..|
|00001a80| 83 c8 09 8e 00 00 00 1c | 00 3e 00 00 4d 50 53 52 |........|.>..MPSR|
|00001a90| 00 01 00 0a 03 ed ff ff | 00 00 00 00 00 00 00 00 |........|........|
|00001aa0| 03 f0 ff ff 00 00 00 4c | 00 18 6b c4 00 00 00 00 |.......L|..k.....|
|00001ab0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001ac0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001ad0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001ae0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001af0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+